﻿Rijschool.betalingen = function ()
{
    var viewModel =
    {
        dataSource: ko.observableArray([]),
        navItems: ko.observableArray([
            { text: "Agenda", icon: "arrowleft" }, { text: "Nieuwe leerling", icon: "add" },{ text: "Log uit", icon: "close" }]),

        navItemClicked: function (e)
        {
            var c = e.itemData.text;
            if (c == "Log uit")
            {
                Rijschool.app.navigate("inlog");
            }
            else if (c == "Nieuwe leerling")
            {
                Rijschool.app.navigate("nieuweLeerling");
            }
            else
            {
                Rijschool.app.navigate("agenda");
            }
        },

        LaadBetalingen: function (test)
        {
            viewModel.dataSource(JSON.parse(httpGet("http://" + window.location.host + "/Site/backend/index.php?betalingen")));
        },
    }
    return viewModel;
}